<script setup lang="ts">
import { provide,ref } from 'vue'
import A from './A.vue'
import { titleKey,refTitleKey } from './symbolkey'
// 把key传入第一个参数的位置，限制第二个参数必须是string类型
provide(titleKey,'this is a title')

const refTitle = ref('this is a refTitle')
provide(refTitleKey,refTitle)

setTimeout(()=>{
  refTitle.value = 'this is a new refTitle'
},2000)
</script>

<template>
  <div>
    this is app
    <A/>
  </div>
</template>

